Deduplicate crypto libraries, saving ~49KB flash#1632
Open
ViezeVingertjes wants to merge 3 commits intomeshcore-dev:devfrom
Open
Deduplicate crypto libraries, saving ~49KB flash#1632ViezeVingertjes wants to merge 3 commits intomeshcore-dev:devfrom
ViezeVingertjes wants to merge 3 commits intomeshcore-dev:devfrom
Conversation
Fixes ed25519_verify() stack overflow by making large locals static, removing the need for rweather's Ed25519::verify() workaround. Vendors only the AES128+SHA256 subset of rweather/Crypto instead of all 37 files.
weebl2000
reviewed
Feb 8, 2026
Contributor
weebl2000
left a comment
There was a problem hiding this comment.
Nice improvement — vendoring the minimal subset is clean and the stack savings are real (~1.8KB moved to BSS). One concern about the static locals in ge.c.
weebl2000
approved these changes
Feb 8, 2026
JosiahWI
reviewed
Feb 9, 2026
JosiahWI
left a comment
There was a problem hiding this comment.
The code looks great. I'm giving my capstone team an opportunity to build this PR and test it and then I'll approve. :)
25b64dd to
48019bf
Compare
…_verify to ensure thread safety during concurrent calls.
JosiahWI
approved these changes
Feb 9, 2026
There was a problem hiding this comment.
The reduction in program size from this PR will be very useful for my school capstone. One of my teammates has built our branch with it and confirmed that the Flash saving makes it possible to fit the program on an nRF52840 Dongle alongside an InternalFS and DFU bootloader.
Edit: The above is only possible if you are not using a display.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a stack overflow in ed25519_verify() by making large local variables static, removing the need for rweather's Ed25519::verify() workaround.
Only vendors the AES128+SHA256 subset of rweather/Crypto instead of all 37 files.
No issues observed so far. Additional testing and confirmation are welcome. This change frees up stack space for future improvements and improves support for resource-limited devices.